<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let obj = {
            uname: '曾鹏',
            age: 18,
            music: function () {
                console.log('我会跳舞');
            },
            fun: fn
        }
        //外部定义的方法
        function fn() {
            console.log('我是测试函数');
        }
        //新增方法
        obj.sing = function () {
            console.log('我会唱歌');
        }
        obj.fun()
        obj.music()
        // 调用新增方法
        obj.sing()
    </script>
</body>

</html>